/**
 * Copyright (C), 2015-2018, 成都启迪信息技术有限公司
 * FileName: CacheController
 * Author:   sjkyll
 * Date:     2018-08-06 16:47
 * Description:
 * <author>          <time>          <version>          <desc>
 * 作者姓名         修改时间           版本号            描述
 */
package com.cdqidi.smsservice.controller;

import com.cdqidi.smsservice.service.CacheService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * 〈一句话功能简述〉<br>
 *
 * @author sjkyll
 * @create 2018-08-06 16:47
 * @since 1.0.0
 */
@RestController
@RequestMapping("/cache")
public class CacheController {

    @Autowired
    private CacheService cacheService;

    @RequestMapping("/delete/{appid}")
    public String delete(@RequestParam(name = "appid") String appId) {
        cacheService.deleteCpConfig(appId);
        return "ok";
    }

    @RequestMapping("/flush")
    public String flush() {
        cacheService.flushCpConfig();
        return "ok";
    }
}